﻿module Test

open Xunit

/// Checks if the specified condition is false.
let no message (condition:bool) = Assert.False(condition, message)
/// Checks if the specified function returns false.
let nof message (condition:unit -> bool) = no message (condition())

/// Checks if the specified condition is true.
let yes message (condition:bool) = Assert.True(condition, message)
/// Checks if the specified function returns true.
let yesf message (condition:unit -> bool) = yes message (condition())

/// Checks if the expected and actual values are a reference to the same object.
let same message expected actual = Assert.Same(expected, actual)

/// Checks if the expected and actual values are equal.
let eq<'a> message (expected:'a) (actual:'a) = Assert.Equal<'a>(expected, actual)

/// Checks if the specified value is of the specified type.
let typeof<'a> message value = yes message (value.GetType() = Operators.typedefof<'a>)

/// Marks a function as a test.
type CaseAttribute() =
    inherit FactAttribute()